<!DOCTYPE html>
<html lang="en">
	<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<title>startDrag</title>
	<script type="text/javascript" src="../../lufylegend-1.8.12.min.js"></script>
	</head>
	<body>
			<div id="legend"></div>
<script>
var tt;
init(1000/50,"legend",800,450,main);
function main(){
	tt = new LTextField();
	tt.size = 18;
	tt.x = 10;
	tt.y = 5;
	tt.text = "使用鼠标拖动下面的方块进行测试";
	addChild(tt);
	var layer;
	for(var i=0;i<3;i++){
		layer = new LSprite();
		layer.x = 120*i;
		layer.graphics.drawRect(2,"#ff0000",[100,100,50,50],true,"#ff0000");
		layer.addEventListener(LMouseEvent.MOUSE_DOWN,ondown);
		layer.addEventListener(LMouseEvent.MOUSE_UP,onup);
		addChild(layer);
	}
}
function ondown(e){
	e.clickTarget.startDrag();
}
function onup(e){
	e.clickTarget.stopDrag();
}
</script>
	</body>
</html>
